home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
apps
/
ibrowse
/
open_script
< prev
next >
Wrap
Text File
|
1994-08-01
|
1KB
|
65 lines
#! /bin/csh
#
# Script to execute when the icon for an SGI-type image is double-clicked
# in ibrowse. To set it up, type
# setenv IBROWSE_SGI_OPEN <path>/open_script
# where <path> is the full path name to the file, before running ibrowse.
#
# 11/30/93
#
set filename = ${IBROWSE_CUR_DIR}/${IBROWSE_NAME}
# Choose action based on which modifier keys are pressed.
switch ( ${IBROWSE_MODIFIERS} )
case 0:
# Get the dimensions of the image. Use ipaste unless image is larger than
# screen size, in which case use scope.
#
set s = `/usr/sbin/istat $filename | tail -1`
set xsize = $s[1]
set ysize = $s[2]
if ( $xsize > 1280 || $ysize > 1024 ) then
/usr/sbin/scope $filename
else
/usr/sbin/ipaste $filename
breaksw
case 1:
case 3:
case 5:
case 7:
# Shift-key and any other modifiers - Always use ipaste.
/usr/sbin/ipaste $filename
breaksw
case 2:
case 6:
# Ctrl-key (and possibly Alt-key) - Always use scope.
/usr/sbin/scope $filename
breaksw
case 4:
# Alt-key - Offer a menu.
set choice = `/usr/bin/X11/xconfirm -t "Please select an action:" -B Cancel -b Print -b Edit -icon question`
switch ( $choice )
case Edit:
/usr/sbin/imgworks $filename
breaksw
case Print:
/usr/bin/lp $filename
breaksw
case Cancel:
breaksw
endsw
breaksw
default:
endsw